<?php
set_time_limit(0);
include_once("../c/config.php");
$mysqli = new mysqli($dbhost, $dbuser, $dbpwd, $dbName);
if (!$mysqli->set_charset("utf8")) {printf("Error loading character set utf8: %s\n", $mysqliTwo->error);}
//http://mei94.com/si/set-ti/3.php
$nianji=3;
$query=$mysqli->query("select id,title,da,db,dc,dd,dan from ti  ");
$tiAInfo=array();
while ($list=$query->fetch_array()){
    $tiAInfo[]=array('id'=>$list['id'],'title'=>$list['title'],'da'=>$list['da'],'db'=>$list['db'],
        'dc'=>$list['dc'],'dd'=>$list['dd'],'dan'=>$list['dan']
    );
}
for ($j=1;$j<100;$j++){
    shuffle($tiAInfo);
    file_put_contents('../tiKu/'.$nianji.'-'.$j.'.txt', json_encode(array('a'=>$tiAInfo)));
}
echo $nianji;

$mysqli->close();